package main

import "fmt"

type Student struct {
	Name   string            `json:"name,omitempty"`
	Age    int               `json:"age,omitempty"`
	Scores [5]float64        `json:"scores,omitempty"`
	Ptr    *int              `json:"ptr,omitempty"`
	Slice  []int             `json:"slice,omitempty"`
	Map1   map[string]string `json:"map_1,omitempty"`
}

//给Student类型绑定一个方法
func (stu *Student) test() {
	stu.Name = "jack"
	fmt.Printf("name = %q\n", stu.Name)
}

func main() {
	//定义结构体
	var stu Student
	stu.Name = "tom"
	stu.test()
	fmt.Printf("stu = %v\n", stu)
}
